<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?php echo ($meta_title); ?>|OneThink管理平台</title>
    <link href="/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
	<link rel="stylesheet" type="text/css" href="/Public/Admin/css/<?php echo (C("COLOR_STYLE")); ?>.css" media="all">
	

     <!--[if lt IE 9]>
    <script type="text/javascript" src="/Public/static/jquery-1.10.2.min.js"></script>
    <![endif]--><!--[if gte IE 9]><!-->
    <script type="text/javascript" src="/Public/static/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/jquery.mousewheel.js"></script>
    <script src="/Public/static/thinkbox/laydate.js"></script>
    <script src="/Public/static/echarts.min.js"></script>
    <script src="/Public/static/macarons.js"></script>
	<!-- <script type="text/javascript" src="/Public/static/lte-ie7.js"></script> -->
    <!--<![endif]-->
    
</head>
<body>
    <div class="main-title">
        <h2>佣金发放</h2>
    </div>
    <form action="<?php echo U(‘yongjin’);?>" id="commentForm" method="post"  class="form-horizontal" >
    <!-- 判断插入ID是否为空，如不为空隐藏插入ID值 -->
        <?php if(!empty($data['id'])): ?><input type="hidden" name="id" value="<?php echo ($data['id']); ?>"/><?php endif; ?>

        <div class="form-item">
            <label class="item-label">顾客姓名<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="name" value="<?php echo ($data["name"]); ?>" disabled="false">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">顾客手机号码<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="phone" value="<?php echo ($data["phone"]); ?>" disabled="false">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">获取客服<span class="check-tips"></span></label>
            <div class="controls">
                <select name="kf" disabled="false">
                            <?php if(count($kefu) !== 1){echo "<option value=''>未分配客服</option>";} ?>
                      <?php if(is_array($kefu)): $i = 0; $__LIST__ = $kefu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ((isset($vo["uid"]) && ($vo["uid"] !== ""))?($vo["uid"]):null); ?>" <?php if(($vo["uid"]) == $data["kf"]): ?>selected<?php endif; ?>><?php echo ((isset($vo["nickname"]) && ($vo["nickname"] !== ""))?($vo["nickname"]):null); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">渠道<span class="check-tips"></span></label>
            <div class="controls">
                <select name="qd" disabled="false">
                      <?php if(is_array($qudao)): $i = 0; $__LIST__ = $qudao;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ((isset($vo["uid"]) && ($vo["uid"] !== ""))?($vo["uid"]):null); ?>" <?php if(($vo["uid"]) == $data["qd"]): ?>selected<?php endif; ?>><?php echo ((isset($vo["name"]) && ($vo["name"] !== ""))?($vo["name"]):null); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
        </div>
		<div class="form-item">
            <label class="item-label">A客奖金<span class="check-tips"></span></label>
            <div class="controls">
                <select name="akjj">
						<option value="2" <?php if(($data["akjj"]) == "2"): ?>selected<?php endif; ?>>未发</option>
						<option value="1" <?php if(($data["akjj"]) == "1"): ?>selected<?php endif; ?>>已发</option>
                </select>
            </div>
        </div>
		<div class="form-item">
            <label class="item-label">成交奖金<span class="check-tips"></span></label>
            <div class="controls">
                <select name="cjjj">
						<option value="2" <?php if(($data["cjjj"]) == "2"): ?>selected<?php endif; ?>>未发</option>
						<option value="1" <?php if(($data["cjjj"]) == "1"): ?>selected<?php endif; ?>>已发</option>
                </select>
            </div>
        </div>


        <div class="form-item">
            <button class="btn submit-btn" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:window.opener=null;window.open('','_self');window.close();">返 回</button>
        </div>
    </form>
</body>
</block>

<block name="script">
    <script src="/Public/static/thinkbox/jquery.validate.js"></script>
    <script src="/Public/static/thinkbox/jquery.metadata.js"></script>
    <script src="/Public/static/thinkbox/laydate.js"></script>
	<script src="/Public/static/layer/layer.js"></script>
    <script >

    $().ready(function() {
         $("#commentForm").validate({

          rules: {
           name: { required:true
           },
           phone: {
            isMobile : true
           },
           yytime:{
            required: true,
            dateISO:true
           }
          },
           messages: {
               name: "请输入姓名！",
               phone: {
                required: "请输入手机号码！",
                isMobile: "请输入正确的手机号码！"
               },
               yytime:{
                required:"请填写预约时间！",
                dateISO:"请填写正确预约时间！"
               }
            },
            submitHandler : function(form){

            $.ajax({
                type: "POST",
                url: "<?php echo U('yongjin');?>",
                data: $(form).serialize(),
                success: function(msg){
					layer.msg(msg.info, {icon: 1});
                    setTimeout(function(){
						window.parent.location.reload(); //刷新父页面
                    },2000); //延迟演示
                },
            });
            $('#submit').attr("disabled","false");
            }

         });

          return false;   
        });
    </script>